import moment from "moment";

export interface IApplicationInfoDto {
  version: string | undefined;
  releaseDate: moment.Moment;
  features:
    | {
        [key: string]: boolean;
      }
    | undefined;
}
export interface IUserLoginInfoDto {
  name: string | undefined;
  surname: string | undefined;
  userName: string | undefined;
  emailAddress: string | undefined;
  id: number;
}
export interface IEditionInfoDto {
  displayName: string | undefined;
  trialDayCount: number | undefined;
  monthlyPrice: number | undefined;
  annualPrice: number | undefined;
  isHighestEdition: boolean;
  isFree: boolean;
  id: number;
}
export interface ITenantLoginInfoDto {
  tenancyName: string | undefined;
  name: string | undefined;
  logoId: string | undefined;
  logoFileType: string | undefined;
  customCssId: string | undefined;
  subscriptionEndDateUtc: moment.Moment | undefined;
  isInTrialPeriod: boolean;
  edition: IEditionInfoDto;
  creationTime: moment.Moment;
  subscriptionDateString: string | undefined;
  creationTimeString: string | undefined;
  id: number;
}
export interface IAppSessionService {
  /** 当前应用信息 */
  readonly application: IApplicationInfoDto;
  /** 当前用户 */
  readonly user: IUserLoginInfoDto;
  /** 当前用户id */
  readonly userId: number;
  /** 当前租户 */
  readonly tenant: ITenantLoginInfoDto;
  /** 当前租户id */
  readonly tenantId: number;
  /** 初始化 */
  init(): Promise<boolean>;
  /** 获取登录显示名称 */
  getShownLoginName(): string;
  /** 若有需要，切换租户 */
  changeTenantIfNeeded(tenantId?: number): boolean;
}
